using System;
using System.Collections.Generic;
using System.Text;
using Entities;
using DAL;

namespace BUS
{
   public  class tbLoaiMHBUS
    {
        public static void Insert(tbLoaiMH loaiMH)
        {
            tbLoaiMHDAL diendenDAL = new tbLoaiMHDAL();
            diendenDAL.Insert(loaiMH);

        }
        public static void Uptate(tbLoaiMH loaiMH)
        {
            tbLoaiMHDAL loaiMHDAL = new tbLoaiMHDAL();
            loaiMHDAL.Update(loaiMH);

        }
        public static void Delete(int iD)
        {
            tbLoaiMHDAL loaiMHDAL = new tbLoaiMHDAL();
            loaiMHDAL.Delete(iD);
        }
        public static tbLoaiMHCollection Get(string where, int pageindex, int pagesize, string orderby, string orderdirection, out int total)
        {
            tbLoaiMHDAL LoaiMHDAL = new tbLoaiMHDAL();
            return LoaiMHDAL.Get(where, pageindex, pagesize, orderby, orderdirection, out total);
        }
        public static tbLoaiMHCollection GetAll()
        {
            int total = 0;
            tbLoaiMHDAL LoaiMHDAL = new tbLoaiMHDAL();
            return LoaiMHDAL.Get("where 1=1", 0, 0,
            tbLoaiMHColumns.MaLoaiMH.ToString(),
            "ASC", out total);
        }
        public static tbLoaiMH GetByID(int iD)
        {
            int total = 0;
            tbLoaiMHDAL LoaiMHDAL = new tbLoaiMHDAL();
            tbLoaiMHCollection loaiMHCollection = LoaiMHDAL.Get("where " +
            tbLoaiMHColumns.MaLoaiMH.ToString() + "=" + iD.ToString(),
            0, 0, tbLoaiMHColumns.MaLoaiMH.ToString(), "ASC", out total);
            if (loaiMHCollection.Count > 0)
                return loaiMHCollection[0];
            return null;
        }

    }
}
